<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta content="telephone=no" name="format-detection" />
  <title>2018临考押题卷</title>
  <meta itemprop="name" content="谁说人算不如天算？快来和我一起预测押题疯狂提分！" />
  <meta itemprop="image" content="/img/ygshare.jpg" />
  <meta name="description" itemprop="description" content="《高考命题预测与题——2018临考押题卷》首发预售，火热上线！" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <link rel="stylesheet" href="/css/reset.css">
  <link rel="stylesheet" href="/css/normalize.css">
  <link rel="stylesheet" href="/css/yg/success.css">
  <% include ../component/_common_tongji.html %>
    <script>
      var token = window.localStorage.getItem('token');
      if (!token) {
        if (location.search != "") {
          location.replace('/yg' + location.search + "&o=share");
        } else {
          location.replace('/yg?o=share');
        }
      }
      var scale = 1 / devicePixelRatio;
      document.querySelector('meta[name="viewport"]').setAttribute('content', 'width=device-width, initial-scale=' + scale + ', maximum-scale=' + scale + ', minimum-scale=' + scale + ', user-scalable=no');
      document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
    </script>
</head>

<body>
  <div class="content">
    <div class="top">
      <div class="topLeft"></div>
      <div class="topRight"></div>
      <img src="/img/ygsuccess01.jpg" alt="" class="topImg">
      <p><img src="/img/ygsuccess02.jpg" alt="">恭喜您订购成功</p>
    </div>
    <div class="center">
        <div class="topLeft"></div>
        <div class="topRight"></div>
      <img src="/img/ygsuccess04.jpg" alt="" class="centerImg1">
      <img src="/img/ygsuccess05.jpg" alt="" class="centerImg2">
      <a href="https://jq.qq.com/?_wv=1027&k=596KUdq" class="getLink">快速进群</a>
      <p>群内定期上传海量备考复习资料，数学解题图卡、英语语法合集等一应俱全。定期发放天利38套官方活动超值福利。预售商品5月8日正式发货</p>
    </div>
    <div class="bom">
        <div class="topLeft"></div>
        <div class="topRight"></div>
      <img src="/img/ygsuccess03.jpg" alt="">
      <ul>
        <li> 1. 成功缴费预购后，可生成自己的专属报名海报；</li>
        <li>2. 通过专属海报邀请好友扫码预购，每成功邀请一名好友预购，即可领取20元助学金；</li>
        <li>3. 邀请多个好友预购成功，可叠加获得更多助学金；</li>
        <li> 4. 助学金可在预售期结束后进群兑换提现。</li>
      </ul>
    </div>
    <footer>
      <a href="javascript:;" class="btn left">订单查询</a>
      <a href="javascript:;" class="btn right">分享链接</a>
    </footer>
  </div>
  <!-- 分享图片 -->
  <div class="shareImg" style="display:none">
    <div id="sharePic" class="wrap">
      <img id="img" style="width:100%;display:block;border:0;" src="">
    </div>
    <div class="bg">
      <div class="modal">
        长按保存图片
        <br> 发送好友或分享朋友圈
      </div>
    </div>
  </div>
  <script src="https://sfile.tl100.com/js/libs/axios.min.js"></script>
  <script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
  <script src="/js/getuserinfo.js"></script>
  <script src="/js/api.js"></script>
  <script src="/js/wx.js"></script>
  <script>
    // 点击显示图片
    var hrefImg = document.querySelectorAll('.right');
    hrefImg.forEach(function (ele) {
      ele.onclick = function () {
        //this.href = 'share?id='+id;
        clearTimeout(timer);
        document.querySelector('.shareImg').style.display = "block";
        document.querySelector('.content').style.display = 'none';
        var timer = setTimeout(function () {
          document.getElementsByClassName('bg')[0].style.display = 'none';
        }, 3500);
      }
    })

    var invitation_code = '';
    getUserInfo(this,localStorage.getItem('token'),'/api/pre_buy_book/getUserPreBuy',function (res_data) {
      var res = res_data;
      invitation_code = res.data.msg.invitation_code;
    })
    function getBuy() {
      api.post('/api/data_lobo/getPreBuyEnterGroupAddress')
        .then(function (res) {
          if (res.data.res_code == 1) {
            document.querySelector('.getLink').href = res.data.msg
          }
        }).catch(function (error) {
          setLog('/api/data_lobo/getPreBuyEnterGroupAddress:catch', JSON.stringify(error));
        });
    }
    getBuy();
    // 订单查询
    document.querySelector('.left').onclick = function () {
      location.href = '/yg/check';
    }

    // 获取图片
    var ch = document.documentElement.clientHeight;
    var width = document.documentElement.clientWidth;
    document.getElementsByClassName('modal')[0].style['margin-top'] = (ch / 4 -100) + "px";

    api.post('/api/user/getPreBuyShareImage', {
      token: localStorage.getItem('token')
    }).then(function (res) {
      var date = new Date();
      var time = date.getTime();
      document.getElementById('img').src = res.data.msg + '?' + time;
      document.getElementsByClassName('bg')[0].style.display = 'block';

      wxObj({
        shareUrl: "https://m.tl100.com/yg?invitation_code" + invitation_code,
        title: '谁说人算不如天算？快来和我一起预测押题疯狂提分！',
        desc: '《高考命题预测与题——2018临考押题卷》首发预售，火热上线！',
        link: '&',
        imgUrl: 'img/ygshare.jpg'
      });
    });
  </script>
</body>

</html>